import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { ProfileOutlined } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 *
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/BasicInformation',
    name: 'BasicInformation',
    redirect: '/BasicInformation/EnterpriseInformation',
    component: Layout,
    meta: {
      title: '基础信息维护系统',
      icon: renderIcon(ProfileOutlined),
      sort: 0,
    },
    children: [
      {
        path: 'EnterpriseInformation',
        name: 'EnterpriseInformation',
        meta: {
          title: '企业信息',
        },
        component: () => import('@/views/BasicInformation/EnterpriseInformation/index.vue'),
      },
      {
        path: 'EnterpriseInformation/details/:id?',
        name: 'details',
        meta: {
          title: '企业信息详情',
          activeMenu:'EnterpriseInformation',
          hidden: true,
        },
        component: () => import('@/views/BasicInformation/EnterpriseInformation/details.vue'),
      },
      {
        path: 'driver',
        name: 'driver',
        meta: {
          title: '驾驶人信息',
        },
        component: () => import('@/views/BasicInformation/driver/index.vue'),
      },
      {
        path: 'driver/details/:id?',
        name: 'driverDetails',
        meta: {
          title: '驾驶人信息详情',
          activeMenu:'driver',
          hidden: true,
        },
        component: () => import('@/views/BasicInformation/driver/details.vue'),
      },
      {
        path: 'AssociationInformation',
        name: 'AssociationInformation',
        meta: {
          title: '协会信息',
        },
        component: () => import('@/views/BasicInformation/AssociationInformation/index.vue'),
      },
      {
        path: 'AssociationInformation/details/:id?',
        name: 'AssociationInformationDetails',
        meta: {
          title: '协会信息详情',
          activeMenu:'AssociationInformation',
          hidden: true,
        },
        component: () => import('@/views/BasicInformation/AssociationInformation/details.vue'),
      },
      {
        path: 'VehicleInformation',
        name: 'VehicleInformation',
        meta: {
          title: '车辆信息',
        },
        component: () => import('@/views/BasicInformation/VehicleInformation/index.vue'),
      },
      {
        path: 'VehicleInformation/details/:id?',
        name: 'VehicleInformationDetails',
        meta: {
          title: '车辆信息详情',
          activeMenu:'VehicleInformation',
          hidden: true,
        },
        component: () => import('@/views/BasicInformation/VehicleInformation/details.vue'),
      },
      {
        path: 'EquipmentInformation',
        name: 'EquipmentInformation',
        meta: {
          title: '设备信息',
        },
        component: () => import('@/views/BasicInformation/EquipmentInformation/index.vue'),
      },
      {
        path: 'EquipmentInformation/details/:id?',
        name: 'EquipmentInformationDetails',
        meta: {
          title: '设备信息详情',
          activeMenu:'EquipmentInformation',
          hidden: true,
        },
        component: () => import('@/views/BasicInformation/EquipmentInformation/details.vue'),
      },
      {
        path: 'DepartmentInfomation',
        name: 'DepartmentInfomation',
        meta: {
          title: '部门信息',
        },
        component: () => import('@/views/BasicInformation/DepartmentInfomation/index.vue'),
      },
      {
        path: 'DepartmentInfomation/details/:id?',
        name: 'DepartmentInfomationDetails',
        meta: {
          title: '部门信息详情',
          activeMenu:'DepartmentInfomation',
          hidden: true,
        },
        component: () => import('@/views/BasicInformation/DepartmentInfomation/details.vue'),
      },
      {
        path: 'DepartmentUser',
        name: 'DepartmentUser',
        meta: {
          title: '部门人员信息',
        },
        component: () => import('@/views/BasicInformation/DepartmentUser/index.vue'),
      },
      {
        path: 'DepartmentUser/details/:id?',
        name: 'DepartmentUserDetails',
        meta: {
          title: '部门人员详情',
          activeMenu:'DepartmentUser',
          hidden: true,
        },
        component: () => import('@/views/BasicInformation/DepartmentUser/details.vue'),
      },
    ],
  },
];

export default routes;
